import React from 'react';
import {WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

// tab页签始终显示
class ETabDisplay extends React.Component {
    state = {
        eIsAlwaysShow: this.props.value
    };

    render() {
        const {eIsAlwaysShow} = this.state;

        return (
            <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@38pkhh`} label={getLabel(516744,'tab页签始终显示') } labelCol={{span: 6}} wrapperCol={{span: 16}}>
                <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@pd1pyo`} display="switch" viewAttr={this.props.disabled ? '1' : '2'} onChange={v=> {this.setState({eIsAlwaysShow : v})}} value={eIsAlwaysShow}/>
                <WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@edkiov`}
                    width={200}
                    style={{paddingLeft: '8px'}}
                    title={getLabel(517098,'关闭时，元素只有一个tab页时不显示tab页签，多个tab页时才显示tab页签；如启用，则只有一个tab页时也会显示tab页签') }
                />
            </WeaFormItem>
        );
    }

    getSaveValues() {
        return this.state.eIsAlwaysShow;
    }
}

export default ETabDisplay;
